package com.itheima.social.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 动态
 * @TableName so_dynamic
 */
@TableName(value ="so_dynamic")
@Data
public class SoDynamic implements Serializable {
    /**
     * 动态主键
     */
    @TableId(type = IdType.AUTO)
    private Integer did;

    /**
     * 图片
     */
    private String pic;

    /**
     * 心情描述
     */
    private String descs;

    /**
     * 位置
     */
    private String pos;

    /**
     * 标签
     */
    private String tag;

    /**
     * 发布时间
     */
    private Integer addtime;

    /**
     * 用户ID
     */
    private Integer uid;

    /**
     * 点赞数量
     */
    private Integer zannum;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SoDynamic other = (SoDynamic) that;
        return (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid()))
            && (this.getPic() == null ? other.getPic() == null : this.getPic().equals(other.getPic()))
            && (this.getDescs() == null ? other.getDescs() == null : this.getDescs().equals(other.getDescs()))
            && (this.getPos() == null ? other.getPos() == null : this.getPos().equals(other.getPos()))
            && (this.getTag() == null ? other.getTag() == null : this.getTag().equals(other.getTag()))
            && (this.getAddtime() == null ? other.getAddtime() == null : this.getAddtime().equals(other.getAddtime()))
            && (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
            && (this.getZannum() == null ? other.getZannum() == null : this.getZannum().equals(other.getZannum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode());
        result = prime * result + ((getPic() == null) ? 0 : getPic().hashCode());
        result = prime * result + ((getDescs() == null) ? 0 : getDescs().hashCode());
        result = prime * result + ((getPos() == null) ? 0 : getPos().hashCode());
        result = prime * result + ((getTag() == null) ? 0 : getTag().hashCode());
        result = prime * result + ((getAddtime() == null) ? 0 : getAddtime().hashCode());
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getZannum() == null) ? 0 : getZannum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", did=").append(did);
        sb.append(", pic=").append(pic);
        sb.append(", descs=").append(descs);
        sb.append(", pos=").append(pos);
        sb.append(", tag=").append(tag);
        sb.append(", addtime=").append(addtime);
        sb.append(", uid=").append(uid);
        sb.append(", zannum=").append(zannum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}